<!DOCTYPE html>  
<html>  
  <head>  
    <title>Arrays</title>  
  </head>
  <body>  
    <script type="text/javascript">  
       
       var cars = ["Volvo", "BMW", "Ford", "Mazda"];
       var myNum = [10, 20, 30, 40];
       
       document.write(cars[0]);document.write("<br>");
       
       cars[0] = "Opel";
       document.write(cars[0]);document.write("<br>");
       
       document.write(cars.length);document.write("<br>");
       
       for (i = 0; i < cars.length; i++) {
         document.write(cars[i]);document.write("<br>");
       }
       
       var emp = new Array();  
       emp[0] = "Ann";  
       emp[1] = "Bob";  
       emp[2] = "Candy";  
       
       for (i=0;i<emp.length;i++){  
         document.write(emp[i] + "<br>");  
       }
       
       var emp = new Array("Ann", "Bob", "Candy"); 
       for (i=0;i<emp.length;i++){  
         document.write(emp[i] + "<br>");  
       }
    </script> 
  </body>  
</html>